<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>行业客户增加</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript">
	$(function() {
		$("#prov").val(11);
		$("#contentForm").validate({
			rules: {
				f_po_name: {
					required: true,
					minlength: 3,
					maxlength: 50
				},
				city: {
					required: true,
				},
				country: {
					required: true,
				},
			},
			messages: {
				f_po_name: {
					required: "请输入客户名称",
					minlength: "客户名称不能少于3位",
					maxlength: "客户名称不能超过50位"
				},
				city: {
					required: "请选择城市",
				},
				country: {
					required: "请选择区县",
				},
			}
		});
		
	});

	function _submitFm() {
		$("#f_po_address").val(getAddress());
		
		arrayToJson();
		if($("#contentForm").validate().form()) {
			$("#f_po_parentId").val(getParentId());
			app_ajax('../../pms/org_add.do', $("#contentForm").serialize(), function(data) {
				if (data.success) {
					$.ajax({
						url: "../../cache/clear_web_cache.do",
						type: "GET",
						data: {},
						dataType: "json",
						success: function(data) {}
					});
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
			});
		}
	}
	
	function getAddress(){
		var prov = $("#prov").val();
		var city = $("#city").val();
		var country = $("#country").val();
		return prov+"-"+city+"-"+country;
	}
	function getParentId(){
		var prov = $("#prov").val();
		var city = $("#city").val();
		var country = $("#country").val();
		return provice[prov]["city"][city].districtAndCountyOrgId[country];
	}
	
	function modelSelect(){
		openDialog($('#model_list'),'../../pms/model_update.jsp');
	}
</script>
<style type="text/css">
</style>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：行业客户管理 &gt; 行业客户新增</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container-1">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input type="hidden" id="f_po_status" name="f_po_status" value="5"/>
					<input type="hidden" id="f_po_address" name="f_po_address" value=""/>
					<input type="hidden" id="f_po_code" name="f_po_code" value=""/>
					<input type="hidden" id="f_po_parentId" name="f_po_parentId" value="0"/>
					<input type="hidden" id="f_po_limitcount" name="f_po_limitcount" value="500"/>
					<legend style="text-align: center; margin: 0 auto;">行业客户新增</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>客户名称:
									</td>
									<td width="30%">
										<input id="f_po_name" name="f_po_name" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_po_name_tip" class="tip"></span>
									</td>
									<td width="20%" align="right">
										<span class="red"></span>模版名称:
									</td>
									<td width="30%">
										<input name="f_po_model_name" id="f_po_model_name" readonly="readonly"	style="width: 150px;" value="" class="yl_inp yw_name" /> 
										<span id="f_po_model_name_tip" class="tip"></span>
										<input type="hidden" id="f_po_model" name="f_po_model"  value="00"/>
										<a id="12" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0);"
											onclick="modelSelect()">选择</a>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;地区:
									</td>
									<td width="30%">
										<select id="prov" onfocus="this.defaultIndex=this.selectedIndedx;" onchange="this.selectedIndex=this.defaultIndex;" value="11" style="width: 80px;">
											<option value="11">浙江省</option>
										</select>
										<select id="city" name="city" onchange="showCountry(this)" value="" style="width: 80px;">
											<option value="">请选择</option>
										</select>
										<select id="country" name="country" value="" style="width: 80px;">
											<option value="">请选择</option>
										</select>
									</td>
									<td width="20%" align="right">
										&nbsp;客户所属行业:
									</td>
									<td width="30%">
										<select name="f_po_industry" id="f_po_industry">
											<option value="10">测试</option>
											<option value="9">公司</option>
											<option value="8">党政军</option>
											<option value="7">党建</option>
											<option value="6">监狱</option>
											<option value="5">医疗</option>
											<option value="4">学校</option>
											<option value="3">休闲</option>
											<option value="2">政企</option>
											<option value="1">酒店</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;平台属性:
									</td>
									<td width="30%">
										<select id="f_po_platform_attr" name="f_po_platform_attr">
											<option value="1">个性化</option>
											<option value="2">农村</option>
											<option value="3">校园</option>
											<option value="4">酒店</option>
											<option value="5">增值</option>
										</select>
									</td>
									<td width="20%" align="right">
										&nbsp;直播地址:
									</td>
									<td width="30%">
										<input id="f_po_live_url" name="f_po_live_url" style="width: 150px;" value="" class="yl_inp yw_name" />
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;虚拟频道清晰度:
									</td>
									<td width="30%">
										<select name="f_po_channel_difinition" id="f_po_channel_difinition">
											<option value="0">标清</option>
											<option value="1">准高清</option>
											<option value="2">高清</option>
										</select>
									</td>
									<td width="20%" align="right">
										&nbsp;平台类型:
									</td>
									<td width="30%">
										<select name="f_po_platform_type" id="f_po_platform_type" style="width: 150px;">
											<option value="0">华为</option>
											<option value="1">UT</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;Logo图标:
									</td>
									<td width="40%" align="right">
										<jsp:include page="../../pictures/pictures_add_industry.jsp" flush="true">
											<jsp:param value="组织" name="picType"/>
										</jsp:include>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="15%" align="right">
										&nbsp;描述:
									</td>
									<td width="85%">
										<textarea id="f_po_desc" name="f_po_desc" style="width: 95%;" rows="4"></textarea>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;默认频道:
									</td>
									<td width="10%">
										<input id="f_po_default_channel" name="f_po_default_channel" style="width: 150px;" value="" class="yl_inp yw_name" />
									</td>
									<td width="20%" align="right">
										&nbsp;宽带电视类型:
									</td>
									<td width="20%">
										<select id="f_po_type" name="f_po_type">
			 								<option value="">请选择</option>
			 								<option value="hd">高清</option>
			 								<option value="sd">标清</option>
			 							</select>
									</td>
									<td width="20%" align="right">
										&nbsp;模板首页设置:
									</td>
									<td width="20%">
										<select id="f_po_model_index_conf" name="f_po_model_index_conf">
			 								<option value="1">直播频道</option>
			 								<option value="2">点播视频</option>
			 								<option value="3">图片轮播</option>
			 							</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					
					
					<div class="toolbar" style="text-align: center;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
							href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
							class="easyui-linkbutton"
							onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
					</div>
				</form>
			</div>
		</div>
		<!--主体 结束-->
		
		
	</div>
	<div id="cast_list" class="easyui-dialog"
		style="width: 600px; height: 470px; padding-top: 0px;"
		data-options="title:'模型选择', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	<div id="model_list" class="easyui-dialog"
		style="width: 600px; height: 470px; padding-top: 0px;"
		data-options="title:'模版选择', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	<div id="dlg" class="easyui-dialog"
		style="width: 800px; height: 500px; padding-top: 0px;"
		data-options="title:'企业管理', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	<script type="text/javascript" src="../../static/js/city/city.js"></script>
	<script type="text/javascript" src="../../static/js/city/method01.js"></script>
</body>
</html>
